PreviousNextTracker indexSee it online !

(293/299) 1787 - SFTP + Java 1.8 = com.jcraft.jsch.JSchException: Auth Cancel

Using JEdit 5.2pre1, FTP 1.1.0, and Oracle Java 8 (jdk1.8.0_05) on Linux, I was unable to make any sftp connections. I was repeatedly getting "Auth Cancel" exceptions thrown.
Switching back to Java 1.7 makes the problem go away.


java.io.IOException: com.jcraft.jsch.JSchException: Auth cancel
at ftp.SFtpConnection.<init>(SFtpConnection.java:148)
at ftp.ConnectionManager.getConnection(ConnectionManager.java:524)
at ftp.FtpVFS.getConnection(FtpVFS.java:529)
at ftp.FtpVFS._listFiles(FtpVFS.java:222)
at org.gjt.sp.jedit.browser.ListDirectoryBrowserTask._run(ListDirectoryBrowserTask.java:74)
at org.gjt.sp.util.Task.run(Task.java:64)
at java.util.concurrent.ThreadPoolExecutor.runWorker(ThreadPoolExecutor.java:1142)
at java.util.concurrent.ThreadPoolExecutor$Worker.run(ThreadPoolExecutor.java:617)
at java.lang.Thread.run(Thread.java:745)

Submitted ezust - 2014-05-07 05:16:29.465000 Assigned
Priority 5 Labels FTP Plugin linux Java 1.8
Status open Group
Resolution None

Comments

2014-05-09 18:47:30.127000
ezust

After committing a recent change to FTP in SVN, I get a more complete stack trace:
com.jcraft.jsch.JSchException: Auth cancel
at com.jcraft.jsch.Session.connect(Session.java:511)
at ftp.SFtpConnection.<init>(SFtpConnection.java:138)
at ftp.ConnectionManager.getConnection(ConnectionManager.java:524)
at ftp.FtpVFS.getConnection(FtpVFS.java:529)
at ftp.FtpVFS._listFiles(FtpVFS.java:222)
at org.gjt.sp.jedit.browser.ListDirectoryBrowserTask._run(ListDirectoryBrowserTask.java:74)
at org.gjt.sp.util.Task.run(Task.java:64)
at java.util.concurrent.ThreadPoolExecutor.runWorker(ThreadPoolExecutor.java:1142)
at java.util.concurrent.ThreadPoolExecutor$Worker.run(ThreadPoolExecutor.java:617)
at java.lang.Thread.run(Thread.java:745)

2014-05-09 18:52:10.278000
ezust

- **summary**: SFTP + Java 1.8 = Auth Cancel error --> SFTP + Java 1.8 = com.jcraft.jsch.JSchException: Auth Cancel
- **Group**: -->

2014-09-12 09:06:54.084000
ezust

Other people are reporting trouble with Jsch + Java 1.8 also:
http://stackoverflow.com/questions/25404371/java8-jcraft-key-is-too-long-for-this-algorithm

2014-09-12 10:03:21.262000
ezust

It's a bug in Java 8.
https://bugs.openjdk.java.net/browse/JDK-8039921
Here is a relevant thread on the jsch-users list:
http://sourceforge.net/p/jsch/mailman/jsch-users/thread/CA%2BKtLoZA6NnZRNxdimpDJ4g94SRa5LKHL5GtLxhUhZVQhimhqQ%40mail.gmail.com/#msg32657232

2014-09-17 12:23:32.414000
zbigz

Just reporting: I'm having the same using jEdit 5.1 and 5.2pre1 (installed it to check if that's not 5.1 bug :/) ...
Both running on Oracle Java 1.7.0_17.

2014-09-17 14:58:16.901000
ezust

If you have an issue with Java 1.7, make sure you have JCE strong encryption installed in your JRE and read the below thread:
http://sourceforge.net/p/jsch/mailman/jsch-users/thread/CA%2BKtLoZA6NnZRNxdimpDJ4g94SRa5LKHL5GtLxhUhZVQhimhqQ%40mail.gmail.com/#msg32657232